﻿<%@ Page Title="My Shop" Language="C#" MasterPageFile="~/Site.Master" EnableEventValidation="false" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="MyShop._Default" %>

<asp:Content runat="server" ID="FeaturedContent" ContentPlaceHolderID="FeaturedContent">
    <section class="featured">
        <div class="discounts">
            <a runat="server" href="~/Discounts.aspx">
                Discounts Content
            </a>
        </div>
    </section>
</asp:Content> 
<asp:Content runat="server" ID="BodyContent" ContentPlaceHolderID="MainContent">
    <div class="left_content_company_list">
         <asp:Repeater id="RepeaterCompany" runat="server">
          <HeaderTemplate>
          </HeaderTemplate>
          <ItemTemplate>
             <div class="company_product_container">
                <%-- <asp:LinkButton href="Default.aspx?id=<%# DataBinder.Eval(Container.DataItem, "ModelName") %>" runat="server" ID="a" OnClick="AllInfoProduct">Model: <%# DataBinder.Eval(Container.DataItem, "ModelName") %> </asp:LinkButton>--%>
                 <a class="company_name_a" href="Default.aspx?companyId=<%# DataBinder.Eval(Container.DataItem, "CompanyID") %>"><%# DataBinder.Eval(Container.DataItem, "Name") %> </a>   
                 <%--<input id="BuyButton" type="button" runat="server" onclick="AddProductInBasket()" value="BUY!"/>--%>
             </div> 
          </ItemTemplate>
          <FooterTemplate>
          </FooterTemplate>

       </asp:Repeater>
        <%--<asp:GridView ID="GridView1" runat="server" AllowPaging="True" AllowSorting="True" AutoGenerateColumns="False" DataSourceID="SqlDataSource1">
        <Columns>
            <asp:BoundField DataField="Name" HeaderText="Company" SortExpression="Name" />
        </Columns>
        </asp:GridView>--%>
    </div>
    <div class="content_product" id="ProductContentId">
        <asp:PlaceHolder runat="server" id="ProductPlaceHolder"></asp:PlaceHolder>
        
        <asp:Repeater id="RepeaterProduct" runat="server">
          <HeaderTemplate>
          </HeaderTemplate>
          <ItemTemplate>
             <div style="width: 200px;float: left; margin: 20px;" class="main_product_container">
                 <img style="width:50px;height:50px;" onclick="" runat="server" src=<%# DataBinder.Eval(Container.DataItem, "ImageFileUrl") %>/>
                <%-- <asp:LinkButton href="Default.aspx?id=<%# DataBinder.Eval(Container.DataItem, "ModelName") %>" runat="server" ID="a" OnClick="AllInfoProduct">Model: <%# DataBinder.Eval(Container.DataItem, "ModelName") %> </asp:LinkButton>--%>
                 <a class="company_name_a" href="Default.aspx?productId=<%# DataBinder.Eval(Container.DataItem, "ID") %>">Model: <%# DataBinder.Eval(Container.DataItem, "ModelName") %> </a>   
                 <%--<input id="BuyButton" type="button" runat="server" onclick="AddProductInBasket()" value="BUY!"/>--%>
                 <asp:Button CommandName='<%# DataBinder.Eval(Container.DataItem, "ID") %>' OnClick="AddProductInBasket"  runat="server" Text="BUY!" ></asp:Button>
             </div> 
          </ItemTemplate>
          <FooterTemplate>
          </FooterTemplate>

       </asp:Repeater>
        <asp:Repeater id="DetailRepeaterProduct" runat="server">
          <HeaderTemplate>
          </HeaderTemplate>
          <ItemTemplate>
             <div style="width: 200px;float: left; margin: 20px;" class="main_product_container">
                 <img id="Img1"  style="width:150px;height:150px;" onclick="" runat="server" src=<%# DataBinder.Eval(Container.DataItem, "ImageFileUrl") %> />
                <%-- <asp:LinkButton href="Default.aspx?id=<%# DataBinder.Eval(Container.DataItem, "ModelName") %>" runat="server" ID="a" OnClick="AllInfoProduct">Model: <%# DataBinder.Eval(Container.DataItem, "ModelName") %> </asp:LinkButton>--%>
                 <a class="company_name_a" href="Default.aspx?productId=<%# DataBinder.Eval(Container.DataItem, "ID") %>">Model: <%# DataBinder.Eval(Container.DataItem, "ModelName") %> </a>   
                 <%--<input id="BuyButton" type="button" runat="server" onclick="AddProductInBasket()" value="BUY!"/>--%>
                 <asp:Button ID="Basket_1" OnClick="AddProductInBasket" runat="server" Text="BUY!" />
             </div> 
             <div class="product_description_class">
                 <div>Description: <%# DataBinder.Eval(Container.DataItem, "Description") %></div>
                 <div>Price: <%# DataBinder.Eval(Container.DataItem, "Price") %></div>
                 <div>Count: <%# DataBinder.Eval(Container.DataItem, "Count") %></div>
             </div>
          </ItemTemplate>
          <FooterTemplate>
          </FooterTemplate>

       </asp:Repeater>

    </div>
    <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:ShopConnectionString %>" SelectCommand="SELECT [Name] FROM [ProductCompany]"></asp:SqlDataSource>
</asp:Content>
